package cc.lishixi.book.dao.mapper;

import cc.lishixi.book.entity.BookInfo;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by LiShixi on 2016/7/24 0024.
 * http://www.lishixi.cc
 */
public class BookInfoRowMapper implements RowMapper<BookInfo> {
    @Override
    public BookInfo mapRow(ResultSet r, int i) throws SQLException {
        BookInfo b = new BookInfo();
        b.setId(r.getInt("id"));
        b.setBarcode(r.getString("barcode"));
        b.setIsbn(r.getString("isbn"));
        b.setStatus(r.getInt("status"));
        b.setDuedate(r.getString("duedate"));
        b.setLocation(r.getString("location"));
        return b;
    }
}
